<?php
//$a=rtrim(shell_exec('python /www/wwwroot/gdmovie.guadou.cyou/6v/getIP.py'));
$data=file_get_contents("http://localhost/api/pyToapi.php?page=detail&movieId={$_GET['movieId']}");
// var_dump($data);
$pgdata=json_decode($data,False)->result;
// var_dump($pgdata->title);
//使用session存储数据
session_start();
$_SESSION['playdataTitle']=$pgdata->title;
$_SESSION['playdataUrl']=$pgdata->playurl;
?>x
<!doctype html>
<html lang="zh-Han">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?php echo $pgdata->title?>-瓜豆影院：极新电影聚集地</title>
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div class="detailtopview">
<!--        title-->
        <div class="detailtoptitle"><h1><?php  echo $pgdata->title?></h1></div>
<!--        img-->
        <div class="detailbodyview">
            <div class="detail_summary">
                <div class="detailtopimg"><img src="<?php echo $pgdata->img?>" alt=""/></div>
                <!--        影片简介-->
                <div class="detailcontent">
                    <text>影片简介</text>
                    <?php
                    $content=json_decode(json_encode($pgdata->content,True),True);
                    for ($i=0;$i<=count($content);$i++){
                        $text=str_replace('◎','</br>',$content[$i]["text"]);
                        echo "<text class='detail_summary_text'>$text</text>";
                    }?>
                </div>
            </div>


            <!--        播放地址-->
            <div class="detailplaybox">
                <div class="detailplaytap">
                    <?php
                    $playurl=json_decode(json_encode($pgdata->playurl,True),True);
                    for ($i = 0; $i <= count($playurl[$i]); $i++) {
                        echo "<p><p_title>{$playurl[$i]["playlist"]}</p_title></p>";
                        $itemurl=json_decode(json_encode($playurl[$i]['itemurl'],True),True);
                        for ($j = 0; $j < count($itemurl); $j++) {
                            echo "<div class='detail_play_text'><a class='detail_play_text_text' href=\"/play.php?playId={$itemurl[$j]['url']}\">{$itemurl[$j]['item']}</a></div>";
                        }
                    }
                    ?>


                </div>
            </div>
            <!--        下载地址-->
            <div class="detaildownload"></div>

        </div>
    </div>

</body>
</html>
